package com.meilai.project.dto.business.contract;

import com.meilai.project.dto.business.intentionScheme.PointProcessDateRangeDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author xchen
 * @since 2022-03-02
 */
@Data
@ApiModel
@Validated
public class ContractApplyDTO extends BaseContract {

	@NotNull
	@ApiModelProperty("分时间段数据列表")
	private List<PointProcessDateRangeDTO> dataList;

	@ApiModelProperty("代理情况明细")
	private List<ProxyMediaDetailReq> proxyMediaDetailList;

	@ApiModelProperty("意向方案id列表")
	private List<Long> intention_scheme_id_list;

	public Integer getMediaPointCount() {
		int count = 0;
		for (PointProcessDateRangeDTO dateRangeDTO : dataList) {
			count = count + dateRangeDTO.getPointList().size();
		}
		return count;
	}
}
